package com.iwhalecloud.bss.kite.cucc.service.attr.handler;

import com.iwhalecloud.bss.kite.common.constant.KeyConsts;
import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.manager.api.IQuerySceneInstService;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import com.iwhalecloud.bss.kite.service.attr.handler.AbstractAttrHandler;
import org.springframework.beans.factory.annotation.Autowired;

/**
* @Description: TODO
*
* @author lyx
* @date 2020年12月30日
* @version V1.0
* @Package com.iwhalecloud.bss.kite.cucc.service.attr.handler
*/
public class IsOrderSliceServiceAttrHandler extends AbstractAttrHandler<KiteInst, AttrData> {

    @Autowired
    private IQuerySceneInstService querySceneInstService;

    @Override
    public void onShow(KiteAttr attr, KiteInst inst, AttrData data) {
        // 物联网受理单补录不允许修改信息
        String taskCode = querySceneInstService.getExtParameterValue(data.getSceneInstId(), "taskCode");
        if (KiteStringUtils.equals(taskCode, "OrderAddRecordWLWXS")) {
            attr.setIsEdit(KeyConsts.IFTRUE_F);
        }
        super.onShow(attr, inst, data);
    }
}
